package com.peng.egmybatis1.mapper;

import com.peng.egmybatis1.pojo.entity.Customer;
import com.peng.egmybatis1.pojo.vo.CustomerVO1;
import com.peng.egmybatis1.pojo.vo.CustomerVO2;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author peng
 * @Date 2024-04-19 20:11
 */
@Mapper
public interface CustomerMapper {
    @Insert("insert into customers(cust_id, cust_tel, cust_name, city) " +
            "values(#{customerId},#{customerTel}, #{customerName}, #{city})")
    int insertCustomer(Customer customer);

    /**
     * 根据id查询客户
     * @param customerId 客户ID
     * @return CustomerVO1
     */
    CustomerVO1 selectCustomerById(String customerId);

    /**
     * 根据城市查询客户
     * @param customerVO2 CustomerVO2
     * @return List<CustomerVO2>
     */
    List<CustomerVO2> selectCustomersByCity(CustomerVO2 customerVO2);


}
